package com.wait;

public class CustomThread extends Thread{
	private BreadBox box;
	
	public CustomThread(BreadBox box) {
		this.box=box;
	}
	
	@Override
	public void run() {
		
		for(int i=0;i<10;i++){
			Bread bread=box.get();
			System.out.println(Thread.currentThread().getName()+"消费了第"+bread.getId()+"号面包");
		}
		
	}
	
}
